package com.kevin.v1.mvc.controller;

import com.kevin.v1.mvc.service.MyServiceImpl;
import com.kevin.v1.mvc.service.Myservice;
import com.kevin.v1.springframework.annotation.*;
import com.kevin.v2.spring.formework.webmvc.servlet.ModelAndView;

import java.util.HashMap;
import java.util.Map;

@KvController
@KvRequestMapping("/index")
public class IndexController  {

   @KvAutowired
   MyServiceImpl myservice;


   @KvRequestMapping("/index")
   public ModelAndView index (@KvRequestParam("name") String name) {

      System.out.println("name");
      Map<String, Object> map = new HashMap<>();
      map.put("name", "hello word！");
      myservice.add(name);
      myservice.select(name);
      return new ModelAndView("index.html",map);
   }


}
